package com.bancomer.pig.functions;

public class Concat {
	
	public static String concatStrings(String separator, String ... strings){
		StringBuffer stringConcat=new StringBuffer();
		if(separator==null || separator.equals("null") || separator.equals("")){
			separator = " ";
		}
		for(int i=0;i<strings.length;i++){
			if(strings[i]!=null&&!strings[i].trim().equals("")&&!strings[i].trim().equals("null")){
				stringConcat.append(strings[i].trim());
				stringConcat.append(separator);
			}
		}
		stringConcat.deleteCharAt(stringConcat.length()-1);
		return stringConcat.toString().trim();
	}
}
